<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>wickr-crypto-c: Wickr_crypto_engine</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">wickr-crypto-c
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">Wickr_crypto_engine</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Interface to a set of cryptographic operations used throughout the library. Currently the default implementation of this can be found along with documentation in <a class="el" href="openssl__suite_8h_source.html">openssl_suite.h</a> and <a class="el" href="kdf_8h_source.html">kdf.h</a>.  <a href="structwickr__crypto__engine.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga4d68232f729ffeda16657582a5267d07"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__crypto__engine.html#ga4d68232f729ffeda16657582a5267d07">wickr_crypto_engine_get_default</a> (void)</td></tr>
<tr class="separator:ga4d68232f729ffeda16657582a5267d07"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5709d94cd09ef0fb47d1a5f59232f115"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__crypto__engine.html#ga5709d94cd09ef0fb47d1a5f59232f115">wickr_crypto_engine_kdf_cipher</a> (const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *engine, <a class="el" href="structwickr__kdf__algo.html">wickr_kdf_algo_t</a> algo, <a class="el" href="structwickr__cipher.html">wickr_cipher_t</a> cipher, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *value, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *passphrase)</td></tr>
<tr class="separator:ga5709d94cd09ef0fb47d1a5f59232f115"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab60480270e80ba34aa44385633037983"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__crypto__engine.html#gab60480270e80ba34aa44385633037983">wickr_crypto_engine_kdf_decipher</a> (const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *engine, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *input_buffer, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *passphrase)</td></tr>
<tr class="separator:gab60480270e80ba34aa44385633037983"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga18c21501a41c97f2ba79a9366343cdcf"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__digest.html">wickr_digest_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__crypto__engine.html#ga18c21501a41c97f2ba79a9366343cdcf">wickr_digest_matching_cipher</a> (<a class="el" href="structwickr__cipher.html">wickr_cipher_t</a> cipher)</td></tr>
<tr class="separator:ga18c21501a41c97f2ba79a9366343cdcf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0a708e5e46c40eae5eaeb581f6a1aed2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__digest.html">wickr_digest_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__crypto__engine.html#ga0a708e5e46c40eae5eaeb581f6a1aed2">wickr_digest_matching_curve</a> (<a class="el" href="structwickr__ec__curve.html">wickr_ec_curve_t</a> curve)</td></tr>
<tr class="separator:ga0a708e5e46c40eae5eaeb581f6a1aed2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf44e3be9066727bf83034d3593dc74e2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__cipher.html">wickr_cipher_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__crypto__engine.html#gaf44e3be9066727bf83034d3593dc74e2">wickr_exchange_cipher_matching_cipher</a> (<a class="el" href="structwickr__cipher.html">wickr_cipher_t</a> cipher)</td></tr>
<tr class="separator:gaf44e3be9066727bf83034d3593dc74e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:gae12855853c05caa473e748a62611d307"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__crypto__engine.html#gae12855853c05caa473e748a62611d307">wickr_crypto_engine::wickr_crypto_engine_crypto_random</a> )(size_t len)</td></tr>
<tr class="separator:gae12855853c05caa473e748a62611d307"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabc120effc5248a491b18138f9b74b526"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__crypto__engine.html#gabc120effc5248a491b18138f9b74b526">wickr_crypto_engine::wickr_crypto_engine_cipher_key_random</a> )(<a class="el" href="structwickr__cipher.html">wickr_cipher_t</a> cipher)</td></tr>
<tr class="separator:gabc120effc5248a491b18138f9b74b526"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf7be0d0ca0d9e7a0c5c3b1ec0fd0918e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a> *(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__crypto__engine.html#gaf7be0d0ca0d9e7a0c5c3b1ec0fd0918e">wickr_crypto_engine::wickr_crypto_engine_cipher_encrypt</a> )(const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *plaintext, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *aad, const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *key, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *iv)</td></tr>
<tr class="separator:gaf7be0d0ca0d9e7a0c5c3b1ec0fd0918e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga459ef821cc40edb5e3c9ce1d571ddc00"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__crypto__engine.html#ga459ef821cc40edb5e3c9ce1d571ddc00">wickr_crypto_engine::wickr_crypto_engine_cipher_decrypt</a> )(const <a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a> *cipher_result, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *aad, const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *key, bool only_auth_ciphers)</td></tr>
<tr class="separator:ga459ef821cc40edb5e3c9ce1d571ddc00"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa77b1bc373d92d9db9d801bcc4a4d29c"><td class="memItemLeft" align="right" valign="top">bool(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__crypto__engine.html#gaa77b1bc373d92d9db9d801bcc4a4d29c">wickr_crypto_engine::wickr_crypto_engine_encrypt_file</a> )(const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *key, const char *sourceFilePath, const char *destinationFilePath)</td></tr>
<tr class="separator:gaa77b1bc373d92d9db9d801bcc4a4d29c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga361b843efc839e30f90ce24c15b1dd27"><td class="memItemLeft" align="right" valign="top">bool(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__crypto__engine.html#ga361b843efc839e30f90ce24c15b1dd27">wickr_crypto_engine::wickr_crypto_engine_decrypt_file</a> )(const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *key, const char *sourceFilePath, const char *destinationFilePath, bool only_auth_ciphers)</td></tr>
<tr class="separator:ga361b843efc839e30f90ce24c15b1dd27"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga42dfc5b4df166616d962ee4c792ceaf4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__crypto__engine.html#ga42dfc5b4df166616d962ee4c792ceaf4">wickr_crypto_engine::wickr_crypto_engine_digest</a> )(const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *buffer, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *salt, <a class="el" href="structwickr__digest.html">wickr_digest_t</a> digest_mode)</td></tr>
<tr class="separator:ga42dfc5b4df166616d962ee4c792ceaf4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga298d2dea6722151c11e04458d3924823"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__crypto__engine.html#ga298d2dea6722151c11e04458d3924823">wickr_crypto_engine::wickr_crypto_engine_digest_file</a> )(FILE *in_file, const <a class="el" href="structwickr__digest.html">wickr_digest_t</a> mode)</td></tr>
<tr class="separator:ga298d2dea6722151c11e04458d3924823"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad16b229b7d16cf00d3983c277ee3b88b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__ec__key.html">wickr_ec_key_t</a> *(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__crypto__engine.html#gad16b229b7d16cf00d3983c277ee3b88b">wickr_crypto_engine::wickr_crypto_engine_ec_rand_key</a> )(<a class="el" href="structwickr__ec__curve.html">wickr_ec_curve_t</a> curve)</td></tr>
<tr class="separator:gad16b229b7d16cf00d3983c277ee3b88b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga87a069bbd3cdf509946e4ca0ca008f8f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__ec__key.html">wickr_ec_key_t</a> *(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__crypto__engine.html#ga87a069bbd3cdf509946e4ca0ca008f8f">wickr_crypto_engine::wickr_crypto_engine_ec_key_import</a> )(const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *buffer, bool is_private)</td></tr>
<tr class="separator:ga87a069bbd3cdf509946e4ca0ca008f8f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac5a36d2a53e06a75a2b818e6a5cc96a1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__ecdsa__result.html">wickr_ecdsa_result_t</a> *(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__crypto__engine.html#gac5a36d2a53e06a75a2b818e6a5cc96a1">wickr_crypto_engine::wickr_crypto_engine_ec_sign</a> )(const <a class="el" href="structwickr__ec__key.html">wickr_ec_key_t</a> *ec_signing_key, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *data_to_sign, const <a class="el" href="structwickr__digest.html">wickr_digest_t</a> digest_mode)</td></tr>
<tr class="separator:gac5a36d2a53e06a75a2b818e6a5cc96a1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae541acc6433f6f5ffe84382ccd5e4f97"><td class="memItemLeft" align="right" valign="top">bool(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__crypto__engine.html#gae541acc6433f6f5ffe84382ccd5e4f97">wickr_crypto_engine::wickr_crypto_engine_ec_verify</a> )(const <a class="el" href="structwickr__ecdsa__result.html">wickr_ecdsa_result_t</a> *signature, const <a class="el" href="structwickr__ec__key.html">wickr_ec_key_t</a> *ec_public_key, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *data_to_verify)</td></tr>
<tr class="separator:gae541acc6433f6f5ffe84382ccd5e4f97"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab624f62e1d434c5b8222eabd656feb48"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__crypto__engine.html#gab624f62e1d434c5b8222eabd656feb48">wickr_crypto_engine::wickr_crypto_engine_gen_shared_secret</a> )(const <a class="el" href="structwickr__ec__key.html">wickr_ec_key_t</a> *local, const <a class="el" href="structwickr__ec__key.html">wickr_ec_key_t</a> *peer)</td></tr>
<tr class="separator:gab624f62e1d434c5b8222eabd656feb48"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga782e0e8786ecf8a55c8ae2aea2f178aa"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__crypto__engine.html#ga782e0e8786ecf8a55c8ae2aea2f178aa">wickr_crypto_engine::wickr_crypto_engine_hmac_create</a> )(const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *data, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *hmac_key, <a class="el" href="structwickr__digest.html">wickr_digest_t</a> digest_mode)</td></tr>
<tr class="separator:ga782e0e8786ecf8a55c8ae2aea2f178aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga00c52a816403192af5b21d952265d0b6"><td class="memItemLeft" align="right" valign="top">bool(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__crypto__engine.html#ga00c52a816403192af5b21d952265d0b6">wickr_crypto_engine::wickr_crypto_engine_hmac_verify</a> )(const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *data, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *hmac_key, const <a class="el" href="structwickr__digest.html">wickr_digest_t</a> mode, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *expected)</td></tr>
<tr class="separator:ga00c52a816403192af5b21d952265d0b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5ab29968c993423df83c9f1a3d7e685d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__kdf__result.html">wickr_kdf_result_t</a> *(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__crypto__engine.html#ga5ab29968c993423df83c9f1a3d7e685d">wickr_crypto_engine::wickr_crypto_kdf_gen</a> )(<a class="el" href="structwickr__kdf__algo.html">wickr_kdf_algo_t</a> algo, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *passphrase)</td></tr>
<tr class="separator:ga5ab29968c993423df83c9f1a3d7e685d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga640cbc86ca36c4deb2c197de89dce7d1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__kdf__result.html">wickr_kdf_result_t</a> *(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__crypto__engine.html#ga640cbc86ca36c4deb2c197de89dce7d1">wickr_crypto_engine::wickr_crypto_kdf_meta</a> )(const <a class="el" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a> *existing_meta, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *passphrase)</td></tr>
<tr class="separator:ga640cbc86ca36c4deb2c197de89dce7d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga4d68232f729ffeda16657582a5267d07"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4d68232f729ffeda16657582a5267d07">&#9670;&nbsp;</a></span>wickr_crypto_engine_get_default()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> wickr_crypto_engine_get_default </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Wickr default crypto engine</p>
<dl class="section return"><dt>Returns</dt><dd>an engine containing default crypto primitive implementations (currently implemented with OpenSSL 1.0.2, libscrypt, libbcrypt) </dd></dl>

</div>
</div>
<a id="ga5709d94cd09ef0fb47d1a5f59232f115"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5709d94cd09ef0fb47d1a5f59232f115">&#9670;&nbsp;</a></span>wickr_crypto_engine_kdf_cipher()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a>* wickr_crypto_engine_kdf_cipher </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *&#160;</td>
          <td class="paramname"><em>engine</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__kdf__algo.html">wickr_kdf_algo_t</a>&#160;</td>
          <td class="paramname"><em>algo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__cipher.html">wickr_cipher_t</a>&#160;</td>
          <td class="paramname"><em>cipher</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>passphrase</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Encrypt a buffer with a KDF + CIPHER</p>
<p>The KDF + CIPHER functions currently acts as follows:</p>
<ol type="1">
<li>Calculate KDF(randomSalt || passphrase)</li>
<li>Use the output of step 1. as a cipher key to encrypt the buffer 'value' with the default engine cipher</li>
<li>The output of step 2 is then packed as | KDF_ID | RANDOM_SALT | CIPHER_TEXT |</li>
</ol>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">engine</td><td>the engine to use for ciphering / kdf functions </td></tr>
    <tr><td class="paramname">algo</td><td>the kdf algorithm to use for key derivation </td></tr>
    <tr><td class="paramname">cipher</td><td>the cipher to use to encrypt 'value' with the output of the KDF function with 'passphrase' as input </td></tr>
    <tr><td class="paramname">value</td><td>the value to protect with the KDF cipher </td></tr>
    <tr><td class="paramname">passphrase</td><td>the KDF input to use for getting a cipher key </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a buffer serialized in the following format: </dd></dl>

</div>
</div>
<a id="gab60480270e80ba34aa44385633037983"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab60480270e80ba34aa44385633037983">&#9670;&nbsp;</a></span>wickr_crypto_engine_kdf_decipher()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a>* wickr_crypto_engine_kdf_decipher </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *&#160;</td>
          <td class="paramname"><em>engine</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>input_buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>passphrase</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">engine</td><td>the engine to use for deciphering / kdf functions </td></tr>
    <tr><td class="paramname">input_buffer</td><td>the output of a kdf + cipher operation with 'wickr_crypto_engine_kdf_cipher' </td></tr>
    <tr><td class="paramname">passphrase</td><td>the passphrase for the kdf + cipher operation </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the original buffer protected by 'wickr_crypto_engine_kdf_cipher' or NULL if the KDF + cipher function fails due to an incorrect passphrase </dd></dl>

</div>
</div>
<a id="ga18c21501a41c97f2ba79a9366343cdcf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga18c21501a41c97f2ba79a9366343cdcf">&#9670;&nbsp;</a></span>wickr_digest_matching_cipher()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__digest.html">wickr_digest_t</a> wickr_digest_matching_cipher </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__cipher.html">wickr_cipher_t</a>&#160;</td>
          <td class="paramname"><em>cipher</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get the matching digest type for a function based on size</p>
<p>DEPRECATED IN FAVOR OF wickr_exchange_kdf_matching_cipher</p>
<p>NOTE: Currently only 256bit AES ciphers are supported, so this function always returns SHA_256</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cipher</td><td>the cipher to find the matching digest for </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a digest that has an output which is the same size as the length of the cipher's key </dd></dl>

</div>
</div>
<a id="ga0a708e5e46c40eae5eaeb581f6a1aed2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0a708e5e46c40eae5eaeb581f6a1aed2">&#9670;&nbsp;</a></span>wickr_digest_matching_curve()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__digest.html">wickr_digest_t</a> wickr_digest_matching_curve </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__ec__curve.html">wickr_ec_curve_t</a>&#160;</td>
          <td class="paramname"><em>curve</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get the matching digest for a curve, this is to be used for signature operations using this curve</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">curve</td><td>a curve to get the matching digest for </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the digest to use for signature operations using 'curve' </dd></dl>

</div>
</div>
<a id="gaf44e3be9066727bf83034d3593dc74e2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf44e3be9066727bf83034d3593dc74e2">&#9670;&nbsp;</a></span>wickr_exchange_cipher_matching_cipher()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__cipher.html">wickr_cipher_t</a> wickr_exchange_cipher_matching_cipher </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__cipher.html">wickr_cipher_t</a>&#160;</td>
          <td class="paramname"><em>cipher</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get the matching exchange cipher given a message packet cipher</p>
<p>An exchange cipher is used for wrapping / unwrapping packet content decryption key material (see wickr_key_exchange_create_with_packet_key) This function currently always returns CIPHER_ID_AES256_CTR The lack of authentication on this layer is a performance / space optimization, since it is ultimately protecting authenticated mode key material (currently always CIPHER_ID_AES256_GCM) to be used for packet content decryption If bits are flipped in the key exchange itself, the resulting unauthenticated output will not be able to decrypt the GCM mode packet content</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cipher</td><td>the cipher being used for packet content encryption / decryption </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the exchange cipher matching 'cipher' </dd></dl>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="ga459ef821cc40edb5e3c9ce1d571ddc00"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga459ef821cc40edb5e3c9ce1d571ddc00">&#9670;&nbsp;</a></span>wickr_crypto_engine_cipher_decrypt</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a>*(* wickr_crypto_engine::wickr_crypto_engine_cipher_decrypt) (const <a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a> *cipher_result, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *aad, const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *key, bool only_auth_ciphers)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Decrypt a cipher_result</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cipher_result</td><td>a cipher result generated from 'wickr_crypto_engine_cipher_encrypt' </td></tr>
    <tr><td class="paramname">aad</td><td>additional data to authenticate with the ciphertext (only works with authenticated ciphers) </td></tr>
    <tr><td class="paramname">key</td><td>the key to use to attempt to decrypt 'cipher_result' </td></tr>
    <tr><td class="paramname">only_auth_ciphers</td><td>if true, only authenticated ciphers may be used for decryption </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a buffer containing decrypted bytes. If the AES mode is authenticated, NULL will be returned if key is incorrect. </dd></dl>

</div>
</div>
<a id="gaf7be0d0ca0d9e7a0c5c3b1ec0fd0918e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf7be0d0ca0d9e7a0c5c3b1ec0fd0918e">&#9670;&nbsp;</a></span>wickr_crypto_engine_cipher_encrypt</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a>*(* wickr_crypto_engine::wickr_crypto_engine_cipher_encrypt) (const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *plaintext, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *aad, const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *key, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *iv)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Encrypt a buffer</p>
<p>NOTE: IV is randomly chosen using a secure random function if one is not provided</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">plaintext</td><td>the content to encrypt using 'key' </td></tr>
    <tr><td class="paramname">aad</td><td>additional data to authenticate with the ciphertext (only works with authenticated ciphers) </td></tr>
    <tr><td class="paramname">key</td><td>the cipher key to use to encrypt 'plaintext' </td></tr>
    <tr><td class="paramname">iv</td><td>an initialization vector to use with the cipher mode, or NULL if one should be chosen at random </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a cipher result containing encrypted bytes, or NULL if the cipher mode fails or is not supported </dd></dl>

</div>
</div>
<a id="gabc120effc5248a491b18138f9b74b526"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabc120effc5248a491b18138f9b74b526">&#9670;&nbsp;</a></span>wickr_crypto_engine_cipher_key_random</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a>*(* wickr_crypto_engine::wickr_crypto_engine_cipher_key_random) (<a class="el" href="structwickr__cipher.html">wickr_cipher_t</a> cipher)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Generate a secure random cipher key for a particular cipher</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cipher</td><td>the cipher to generate a random key for </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a cipher key containing key material generated by a secure random function or NULL if random byte generation fails </dd></dl>

</div>
</div>
<a id="gae12855853c05caa473e748a62611d307"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae12855853c05caa473e748a62611d307">&#9670;&nbsp;</a></span>wickr_crypto_engine_crypto_random</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a>*(* wickr_crypto_engine::wickr_crypto_engine_crypto_random) (size_t len)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Generate secure random bytes</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">len</td><td>the number of bytes to generate </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a buffer containing 'len' secure random bytes or NULL if random byte generation fails </dd></dl>

</div>
</div>
<a id="ga361b843efc839e30f90ce24c15b1dd27"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga361b843efc839e30f90ce24c15b1dd27">&#9670;&nbsp;</a></span>wickr_crypto_engine_decrypt_file</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool(* wickr_crypto_engine::wickr_crypto_engine_decrypt_file) (const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *key, const char *sourceFilePath, const char *destinationFilePath, bool only_auth_ciphers)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Decrypt a file</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">in_file</td><td>the encrypted file to decrypt </td></tr>
    <tr><td class="paramname">key</td><td>the key to use for decryption </td></tr>
    <tr><td class="paramname">out_file</td><td>the file to write the decrypted data from 'in_file' </td></tr>
    <tr><td class="paramname">only_auth_ciphers</td><td>if true, only authenticated ciphers may be used for decryption </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if the decryption operation succeeds, and 'out_file' can be written </dd></dl>

</div>
</div>
<a id="ga42dfc5b4df166616d962ee4c792ceaf4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga42dfc5b4df166616d962ee4c792ceaf4">&#9670;&nbsp;</a></span>wickr_crypto_engine_digest</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a>*(* wickr_crypto_engine::wickr_crypto_engine_digest) (const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *buffer, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *salt, <a class="el" href="structwickr__digest.html">wickr_digest_t</a> digest_mode)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Calculate a hash of a buffer using an optional salt value</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buffer</td><td>the buffer to hash </td></tr>
    <tr><td class="paramname">salt</td><td>a salt value mix with buffer before taking the hash Passing NULL will allow for no salt to be used </td></tr>
    <tr><td class="paramname">mode</td><td>the mode of the hash </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a buffer containing the derived hash or NULL if the hashing operation fails </dd></dl>

</div>
</div>
<a id="ga298d2dea6722151c11e04458d3924823"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga298d2dea6722151c11e04458d3924823">&#9670;&nbsp;</a></span>wickr_crypto_engine_digest_file</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a>*(* wickr_crypto_engine::wickr_crypto_engine_digest_file) (FILE *in_file, const <a class="el" href="structwickr__digest.html">wickr_digest_t</a> mode)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Calculate the hash of a file</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">in_file</td><td>a file to take the hash of it's contents </td></tr>
    <tr><td class="paramname">mode</td><td>the mode to use for calculating the hash </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a buffer containing the output of the chosen mode of the contents of in_file </dd></dl>

</div>
</div>
<a id="ga87a069bbd3cdf509946e4ca0ca008f8f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga87a069bbd3cdf509946e4ca0ca008f8f">&#9670;&nbsp;</a></span>wickr_crypto_engine_ec_key_import</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__ec__key.html">wickr_ec_key_t</a>*(* wickr_crypto_engine::wickr_crypto_engine_ec_key_import) (const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *buffer, bool is_private)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Import an Elliptic Curve key from a buffer</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buffer</td><td>the buffer representing Elliptic Curve key material </td></tr>
    <tr><td class="paramname">is_private</td><td>false if the buffer represents a public key </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>an Elliptic Curve key pair parsed from buffer or NULL if buffer does not contain a valid key, or is_private is incorrectly set </dd></dl>

</div>
</div>
<a id="gad16b229b7d16cf00d3983c277ee3b88b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad16b229b7d16cf00d3983c277ee3b88b">&#9670;&nbsp;</a></span>wickr_crypto_engine_ec_rand_key</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__ec__key.html">wickr_ec_key_t</a>*(* wickr_crypto_engine::wickr_crypto_engine_ec_rand_key) (<a class="el" href="structwickr__ec__curve.html">wickr_ec_curve_t</a> curve)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Generate a random Elliptic Curve keypair</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">curve</td><td>the curve parameters to use for random key pair generation </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a random Elliptic Curve key pair or NULL if the random generation fails </dd></dl>

</div>
</div>
<a id="gac5a36d2a53e06a75a2b818e6a5cc96a1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac5a36d2a53e06a75a2b818e6a5cc96a1">&#9670;&nbsp;</a></span>wickr_crypto_engine_ec_sign</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__ecdsa__result.html">wickr_ecdsa_result_t</a>*(* wickr_crypto_engine::wickr_crypto_engine_ec_sign) (const <a class="el" href="structwickr__ec__key.html">wickr_ec_key_t</a> *ec_signing_key, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *data_to_sign, const <a class="el" href="structwickr__digest.html">wickr_digest_t</a> digest_mode)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sign data using an Elliptic Curve key Data is hashed before signing. This function will calculate ECDSA(SHA2(data_to_sign))</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ec_signing_key</td><td>private signing key to use for the ECDSA algorithm </td></tr>
    <tr><td class="paramname">data_to_sign</td><td>the data to hash with 'digest_mode', and then sign with 'ec_signing_key' </td></tr>
    <tr><td class="paramname">digest_mode</td><td>the digest mode to use for SHA2 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>an ecdsa result containing the output of ECDSA(SHA2(data_to_sign)) or NULL if the 'ec_signing_key' is not a private key </dd></dl>

</div>
</div>
<a id="gae541acc6433f6f5ffe84382ccd5e4f97"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae541acc6433f6f5ffe84382ccd5e4f97">&#9670;&nbsp;</a></span>wickr_crypto_engine_ec_verify</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool(* wickr_crypto_engine::wickr_crypto_engine_ec_verify) (const <a class="el" href="structwickr__ecdsa__result.html">wickr_ecdsa_result_t</a> *signature, const <a class="el" href="structwickr__ec__key.html">wickr_ec_key_t</a> *ec_public_key, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *data_to_verify)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Verify ECDSA signatures</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">signature</td><td>a signature produced with 'wickr_crypto_engine_ec_sign' </td></tr>
    <tr><td class="paramname">ec_public_key</td><td>the public signing key to use for verification </td></tr>
    <tr><td class="paramname">data_to_verify</td><td>the original data that should have been signed with 'ec_public_key'. It will be hashed inside this function as part of the verification process </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if 'signature' can be verified by 'ec_public_key' </dd></dl>

</div>
</div>
<a id="gaa77b1bc373d92d9db9d801bcc4a4d29c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa77b1bc373d92d9db9d801bcc4a4d29c">&#9670;&nbsp;</a></span>wickr_crypto_engine_encrypt_file</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool(* wickr_crypto_engine::wickr_crypto_engine_encrypt_file) (const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *key, const char *sourceFilePath, const char *destinationFilePath)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Encrypt a file</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">in_file</td><td>the file to encrypt </td></tr>
    <tr><td class="paramname">key</td><td>the key to use for encryption </td></tr>
    <tr><td class="paramname">out_file</td><td>a file that should contain the encrypted data </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if encryption succeeds, and 'out_file' can be written </dd></dl>

</div>
</div>
<a id="gab624f62e1d434c5b8222eabd656feb48"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab624f62e1d434c5b8222eabd656feb48">&#9670;&nbsp;</a></span>wickr_crypto_engine_gen_shared_secret</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a>*(* wickr_crypto_engine::wickr_crypto_engine_gen_shared_secret) (const <a class="el" href="structwickr__ec__key.html">wickr_ec_key_t</a> *local, const <a class="el" href="structwickr__ec__key.html">wickr_ec_key_t</a> *peer)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Generate a shared secret given Elliptic Curve Diffie-Hellman parameters</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">local</td><td>the local elliptic curve private key </td></tr>
    <tr><td class="paramname">peer</td><td>the remote elliptic curve public key </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a buffer containing the shared secret computed with 'local' private key and 'peer' public key </dd></dl>

</div>
</div>
<a id="ga782e0e8786ecf8a55c8ae2aea2f178aa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga782e0e8786ecf8a55c8ae2aea2f178aa">&#9670;&nbsp;</a></span>wickr_crypto_engine_hmac_create</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a>*(* wickr_crypto_engine::wickr_crypto_engine_hmac_create) (const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *data, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *hmac_key, <a class="el" href="structwickr__digest.html">wickr_digest_t</a> digest_mode)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Generate an HMAC</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>the data to take the HMAC of </td></tr>
    <tr><td class="paramname">hmac_key</td><td>a key to use for HMAC </td></tr>
    <tr><td class="paramname">mode</td><td>the digest mode to perform HMAC with. This will determine the length of the output </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a buffer containing the HMAC of 'data' with 'hmac_key' </dd></dl>

</div>
</div>
<a id="ga00c52a816403192af5b21d952265d0b6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga00c52a816403192af5b21d952265d0b6">&#9670;&nbsp;</a></span>wickr_crypto_engine_hmac_verify</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool(* wickr_crypto_engine::wickr_crypto_engine_hmac_verify) (const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *data, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *hmac_key, const <a class="el" href="structwickr__digest.html">wickr_digest_t</a> mode, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *expected)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Verify an HMAC against an expected result</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>the data to calculate the expected HMAC with </td></tr>
    <tr><td class="paramname">hmac_key</td><td>the key to use along with 'data' to create the expected HMAC with </td></tr>
    <tr><td class="paramname">mode</td><td>the mode to use for generating the expected HMAC </td></tr>
    <tr><td class="paramname">expected</td><td>the value to compare the generated HMAC with </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if 'expected' is equal to the HMAC of 'data' and 'hmac_key' </dd></dl>

</div>
</div>
<a id="ga5ab29968c993423df83c9f1a3d7e685d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5ab29968c993423df83c9f1a3d7e685d">&#9670;&nbsp;</a></span>wickr_crypto_kdf_gen</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__kdf__result.html">wickr_kdf_result_t</a>*(* wickr_crypto_engine::wickr_crypto_kdf_gen) (<a class="el" href="structwickr__kdf__algo.html">wickr_kdf_algo_t</a> algo, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *passphrase)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Execute a KDF function given an input buffer</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">algo</td><td>the algorithm info to use for execution of the KDF </td></tr>
    <tr><td class="paramname">passphrase</td><td>bytes to use as input to the KDF function. There are no restrictions for the content of the buffer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the output of the KDF function, including the generated random salt that was used for the computation </dd></dl>

</div>
</div>
<a id="ga640cbc86ca36c4deb2c197de89dce7d1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga640cbc86ca36c4deb2c197de89dce7d1">&#9670;&nbsp;</a></span>wickr_crypto_kdf_meta</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__kdf__result.html">wickr_kdf_result_t</a>*(* wickr_crypto_engine::wickr_crypto_kdf_meta) (const <a class="el" href="structwickr__kdf__meta.html">wickr_kdf_meta_t</a> *existing_meta, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *passphrase)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Execute a KDF function given an input buffer and specified parameters</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">existing_meta</td><td>the parameters to use for execution, including a specific salt </td></tr>
    <tr><td class="paramname">passphrase</td><td>bytes to use as input to the KDF function. There are no restrictions for the content of the buffer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the output of the KDF function, including the generated random salt that was used for the computation </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>
